﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Templates/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="PageList.aspx.cs" Inherits="VIT.Web.Admin.PageList" %>
<%@ Register Assembly="VIT.Web.Controls" Namespace="VIT.Web.Controls" TagPrefix="VIT" %>

<asp:Content ID="HeadContent" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript" src="<%=URLRoot %>Admin/Includes/VIT.js"></script>
    <title>Danh sách các trang tĩnh</title>
</asp:Content>
<asp:Content ID="MainContent" ContentPlaceHolderID="MainContent" runat="server">
    
    <form id="aspnetForm" runat="server">
    <asp:Panel ID="pnAlert" runat="server">
        <p class="msg error" id="msgError" runat="server" visible="false">Không thể xóa dữ liệu.</p>
        <p class="msg done" id="msgSuccess" runat="server" visible="false">Dữ liệu đã được xóa thành công.</p>
    </asp:Panel>
    <div style="clear:both; margin:10px;">
         Ngôn ngữ: <asp:DropDownList ID="ddlLang" runat="server" AutoPostBack="True" onselectedindexchanged="ddlLang_SelectedIndexChanged"></asp:DropDownList>
    </div>
    <div class="toolbar">
        <VIT:Submit ID="Insert" runat="server" Function="Page_Insert" ToolTip="Thêm" CssClass="icon-32-add" BorderStyle="None" OnClick="Insert_Click"/>
        <VIT:Submit ID="Delete" runat="server" Function="Page_Delete" ToolTip="Xóa" CssClass="icon-32-delete" BorderStyle="None" OnClick="Delete_Click" OnClientClick="return hasCheck('itemCheckbox','Vui lòng chọn mục để xóa.')  && confirm('Xóa mục được chọn');"/>
    </div>
    <div>
        <table width="100%">
            <asp:ObjectDataSource ID="ODS" runat="server" SortParameterName="SortColumn" SelectMethod="GetData" TypeName="VIT.Web.Admin.PageList"></asp:ObjectDataSource>
            <asp:ListView ID="ListView" runat="server" DataSourceID="ODS">                                
                <LayoutTemplate>
                    <thead>
                        <tr align="center">
                            <th width="2%">#</th>
	                        <th width="2%">
		                        <input type="checkbox" name="toggle" id="toggle" onclick="checkAll('toggle', 'itemCheckbox')"/>
                            </th>
                            <th width="20%">ID</th>		            
                            <th width="30%">Tiêu đề</th>
                            <th>Mô tả</th>                   
                            <th width="5%">Sửa</th>
                        </tr>			
                    </thead>
                    <asp:PlaceHolder runat="server" ID="itemPlaceholder"></asp:PlaceHolder>
                </LayoutTemplate>

	            <ItemTemplate>
	                <tr class="row<%#Container.DataItemIndex%2 %>">
	                    <td align="center"><%#Container.DataItemIndex %></td>
	                    <td align="center">
		                        <input type="checkbox" name="itemCheckbox" value="<%#Eval("Id")%>" />
                            </td>
                        <td align="center"><%#Eval("Id")%></td>
                        <td align="left"><%#Eval("Title")%></td>
                        <td align="left"><%#Eval("Description")%></td>	                    		                	
                        <td align="center"><a href='PageEdit.aspx?sId=<%#Eval("id")%>'>Sửa</a></td>
                    </tr>
                </ItemTemplate>
            </asp:ListView>
        </table>
    </div>
</form>
    <script type="text/javascript">
        $("#aside ul li#PageList").addClass("submenu-active");
    </script>
</asp:Content>
